(function(win,doc){
    function change(){
        doc.documentElement.style.fontSize=doc.documentElement.clientWidth/375*23.4375+'px';
    }
    change();
    win.addEventListener('resize',change,false);
})(window,document);

$(function(){
    //slip组件
    var container = document.getElementById('slip');
    var pages = document.querySelectorAll('.swipe-box');
    var slip = Slip(container, 'y').webapp(pages);
    var orderconulH = $(".ordercon").height() - $(".ordercon h1").outerHeight(true)-$(".orderfooter").outerHeight(true)
    var tsH = orderconulH+"px"
    $(".ordercon ul").height(orderconulH);
    $(".ordercon .ts").height(orderconulH);
    $(".ordercon .ts").css("line-height",tsH);
    //第一页
    $(".one_share2").click(function(){
        $(".oneflip").show();
    })
    $(".oneflip").click(function(){
        $(this).hide();
    })

    //第四页
    $(".sixbtn").click(function(){
        $(".fourslip").hide();
    })

    //订单弹窗
    $(".orderflip").hide();
    $(".orderclose").click(function(){
        $(".orderflip").hide();
    })

    $(".orderbtn").click(function(){
        $(".orderflip").show();
        $(".orderflip").css("opacity",1)
    })

})
//第二页渐显效果
function twoboxshow(){
    $('.two4').animate({opacity: 1},300,function(){
        two2show();
    });
}
function two2show(){
    $('.two2').animate({opacity: 1},200,function(){
        two3show();
    });
}
function two3show(){
    $('.two3').animate({opacity: 1},150,function(){
        two4show();
    });
}
function two4show(){
    $('.two1').animate({opacity: 1},200,function(){
        two5show();
        two6show()
    });
}
function two5show(){
    $('.two5').animate({opacity: 1},200);
}
function two6show(){
    $('.two6').animate({opacity: 1},200,function(){
        two7show();
    });
}
function two7show(){
    $('.two7').animate({opacity: 1},200,function(){
        two8show();
    });
}
function two8show(){
    $('.two8').animate({opacity: 1},150,function(){
        two9show();
    });
}
function two9show(){
    $('.two9').animate({opacity: 1},130,function(){
        two10show();
    });
}
function two10show(){
    $('.two10').animate({opacity: 1},100);
}

//第六页渐显效果
function sixboxshow(){
    $('.six2').animate({opacity: 1},400,function(){
        six3show();
    });
}
function six3show(){
    $('.six3').animate({opacity: 1},500,function(){
        six4show();
    });
}
function six4show(){
    $('.six4').animate({opacity: 1},400,function(){
        six5show();
    });
}
function six5show(){
    $('.six5').animate({opacity: 1},500,function(){
        six6show();
    });
}
function six6show(){
    $('.six6').animate({opacity: 1},400,function(){
        six7show();
    });
}
function six7show(){
    $('.six7').animate({opacity: 1},500,function(){
        six8show();
    });
}
function six8show(){
    $('.six8').animate({opacity: 1},400,function(){
        six9show();
    });
}
function six9show(){
    $('.six9').animate({opacity: 1},500,function(){
        six10show();
    });
}
function six10show(){
    $('.six10').animate({opacity: 1},400,function(){
        six11show();
    });
}
function six11show(){
    $('.six11').animate({opacity: 1},500);
}

//第七页渐显
function sevenboxshow(){
    $('.seven1').animate({opacity: 1},400,function(){
        seven2show();
    });
}
function seven2show(){
    $('.seven2').animate({opacity: 1},500,function(){
        seven3show();
    });
}
function seven3show(){
    $('.seven3').animate({opacity: 1},500,function(){
        seven4show();
    });
}
function seven4show(){
    $('.seven4').animate({opacity: 1},500,function(){
        seven5show();
    });
}
function seven5show(){
    $('.seven5').animate({opacity: 1},500,function(){
        seven6show();
    });
}
function seven6show(){
    $('.seven6').animate({opacity: 1},500,function(){
        seven7show();
    });
}
function seven7show(){
    $('.seven7').animate({opacity: 1},500);
}
function top1(){
    var oneboxTop = $(".onebox")[0].getBoundingClientRect().top;
    var twoboxTop = $(".twobox")[0].getBoundingClientRect().top;
    var threeboxTop = $(".threebox")[0].getBoundingClientRect().top;
    var fourboxTop = $(".fourbox")[0].getBoundingClientRect().top;
    var fiveboxTop = $(".fivebox")[0].getBoundingClientRect().top;
    var sixboxTop = $(".sixbox")[0].getBoundingClientRect().top;
    var sevenboxTop = $(".sevenbox")[0].getBoundingClientRect().top;
    var eightboxTop = $(".sevenbox")[0].getBoundingClientRect().top;
    //第四页引导页显示
    if(fourboxTop == 0 || fiveboxTop == 0){
        if($(".fourslip").attr("s") == 0) {
            $(".fourslip").show();
        }
        $(".fourslip").attr("s",1);
    };
    //第二页渐显
    if(twoboxTop == 0){
        twoboxshow();
    }
    if(oneboxTop == 0 || threeboxTop == 0){
        $(".two1,.two2,.two3,.two4,.two5,.two6,.two7,.two8,.two9,.two10").removeAttr("style").stop();
    }
    //第六页渐显
    if(sixboxTop == 0){
        sixboxshow();
        $(".seven1,.seven2,.seven3,.seven4,.seven5,.seven6,.seven7").removeAttr("style").stop();
    }
    if(fiveboxTop == 0){
        $(".six2,.six3,.six4,.six5,.six6,.six7,.six8,.six9,.six10,.six11").removeAttr("style").stop();
    }
    //第七页渐显
    if(sevenboxTop == 0){
        sevenboxshow();
        $(".six2,.six3,.six4,.six5,.six6,.six7,.six8,.six9,.six10,.six11").removeAttr("style").stop();
    }
    if(eightboxTop == 0){
        $(".six2,.six3,.six4,.six5,.six6,.six7,.six8,.six9,.six10,.six11").removeAttr("style").stop();
    }
}
setInterval("top1()",100);
var indexUrl = $('.shareUrl').val();
var shareIdNew = $(".shareIdNew").val();
var data1={'shareId':shareIdNew};
function upState (){
    console.log(data1);
    reUp=common.post('zyxh','shareUp',data1);
    console.log(reUp.result);
    console.log(reUp.datas['shareId']);
    console.log(reUp.datas['status']);
}
wx.config({
    debug: false,
    appId: '<?php echo $this->signPackage["appId"];?>',
    timestamp: '<?php echo $this->signPackage["timestamp"];?>',
    nonceStr: '<?php echo $this->signPackage["nonceStr"];?>',
    signature: '<?php echo $this->signPackage["signature"];?>',
    jsApiList: [
    'onMenuShareAppMessage',
    'onMenuShareTimeline',
    'onMenuShareQQ',
    'onMenuShareWeibo',
    'onMenuShareQZone'
]
});

title = "您是否为如何培养孩子而感到过苦恼？";
desc = "基因是生命的操纵者和调控者，贯穿人的始终。孩子的天赋潜能和健康信息的奥秘就蕴藏在基因里面。儿童检测通过检测孩子的基因，让父母真正了解自己的孩子。有计划、有目标的科学培养扬长避短，顺势培养；还可以提前获知疾病的遗传信息，合理调整生活方式，为孩子制定科学健康的管理方案。";
links = indexUrl;
imgUrl = "<?= G_SITE_CDN ?>/resources/zyxh/images/share.jpeg";
weixinShare(title, desc, links, imgUrl,upState);







